import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../view/Main.vue'
import User from '../view/User/index.vue'
import home from '../view/home/index.vue'
import Mall from '../view/Mail/index.vue'
import pageOne from '../view/Page/pageOne.vue'
import pageTwo from '../view/Page/pageTwo.vue'

Vue.use(VueRouter)


const routes = [
    {
        path:'/',
        name:'Main',
        component:Main,
        children:[
            {
                path:'/home',
                name:"home",
                component:home
            },
            {
                path:'/user',
                name:'user',
                component:User
            },
            {
                path:'/mall',
                name:'mall',
                component:Mall
            },
            {
                path:'/page1',
                name:'page1',
                component:pageOne
            },
            {
                path:'/page2',
                name:'page2',
                component:pageTwo
            }
        ]
    },
   
]
const router = new VueRouter({
    routes
  })

export default router